<style lang="scss" scoped>
    .mui-table-view{
    	padding-bottom:54px;
    	li{
    		h1{
    			font-size: 14px;
    		}
    	}
    
	}
	.mui-ellipsis{
		display: flex;
		justify-content: space-between ;
		font-size: 12px;
		margin-top: 2px;
		color:#226aff;
		
         }
</style>
<template>
	<div>
		
		<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="item in newlist" :key="item.id">
					<router-link :to="'/home/newslist/newsbody/posts/'+item.id">
						<img class="mui-media-object mui-pull-left" src="">
						<div class="mui-media-body">
							<h1>
								{{ item.title }}
							</h1>
							<p class="mui-ellipsis">
								<span>发表时间:{{ time }}</span>
								<span>发表者id:{{ item.userId }}</span>
							</p>
						</div>
					</router-link>
				</li>
			</ul>
	</div>
</template>
<script type="text/javascript">
	import { Toast } from 'mint-ui'
	export default{
		data(){
			return{
				newlist:[],
				time:'',


			}
		},
		created(){
			this.getNewlist()

		},
		methods:{
			getNewlist(){
				const date = new Date();
                const  dd= date.getDate();
                const  mm= date.getMonth() + 1;
                const  yy = date.getFullYear();
                this.time=`${yy}-${mm}-${dd}`;
				this.$http.get("http://jsonplaceholder.typicode.com/posts").then(function(result){
						// console.log(result.headers);
					if(result.ok==true){
						this.newlist=result.body
					}else{
						Toast("请求失败")
					}
					

				})
			}


		},

	}
</script>
